package com.chixing.day13_list;

import java.util.LinkedList;

public class Student {

    private String stuName;
    private int  stuId;
    private String stuState;
    Student(String name,int id, String state ){
        stuName = name;
        stuId = id;
        stuState = state;
    }

    @Override
    public String toString() {
        return "Student{" +
                "stuName='" + stuName + '\'' +
                ", stuId=" + stuId +
                ", stuState='" + stuState + '\'' +
                '}';
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public int getStuId() {
        return stuId;
    }

    public void setStuId(int stuId) {
        this.stuId = stuId;
    }

    public String getStuState() {
        return stuState;
    }

    public void setStuState(String stuState) {
        this.stuState = stuState;
    }

    //          （1）添加2个学生对象
    static class Test {
        public  void main(String[] args) {
           LinkedList<Student> students = new LinkedList<>();
           students.add(new Student("billy",1,"大一"));
           students.add(new Student("smith",2,"大二"));
//           (2) 获得元素个数
            System.out.println(students.size());
//           (3) 添加一个新学生在第一个位置上
            students.addFirst(new Student("jake",0,"大三"));
//           (4) 获得名称为"katy" 的学生，对象

//           (5)迭代遍历集合
//           (6) 获得第2个学生
//           (7) 删除第1个学生对象
//           (8)将最后一个学生的年龄改为22

        }
    }
}
